import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n= sc.nextInt();
            String[] arr=new String[n];
            for (int i = 0; i < n; i++) {
                arr[i]=sc.next();
            }
            Arrays.sort(arr);
            boolean[] flag=new boolean[n];
            for (int i = 0; i < n-1; i++) {
                if (arr[i].equals(arr[i+1]) || // 两个字符串相等
                        arr[i+1].contains(arr[i])&&arr[i+1].charAt(arr[i].length()) == '/'){
                    flag[i]=true;
                 }
                }
            }
            for (int i = 0; i < n; i++) {
                if (flag[i]==false){
                    System.out.println("mkdir -p "+arr[i]);
                }
            }
            System.out.println();
        }
    }
}
